package com.sky.mapper.admin;

import com.sky.pojo.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    /**
     * 批量插入口味数据
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);
    /**
     * 根据主键删除菜品口味
     *
     * @param ids
     */
    void deleteByDishIds(@Param("ids") List<Long> ids);
    @Delete("delete from dish_flavor where dish_id=#{id}")
    void deleteByDishId(Long id);

    void batchSave(List<DishFlavor> flavors);
    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> getByDishId(Long id);
}